Array.prototype.myForeach = function(handler){
    for(var i=0;i<this.length;i++){
        handler.call(this,this[i],i)
    }
}

var arr = ["moyu","momo","tom"];
arr.myForeach(function(item,i){
    console.log(i,item,this);
})
